//json数据
new Vue({
	el: '#app',
	data: {
		message: '正在请求数据......'
	},
	mounted() {
		axios
			.get('js/dynamic.json')
			.then(response => (this.message = response.data.url))
			.catch(function(error) {
				console.log(error);
			});
	}
})


//**********主页************//
var nav = document.querySelectorAll(".nav-item");
var navv = document.querySelectorAll(".nav-item a");
var tab = document.querySelector("nav ul");
var tab1 = document.querySelector(".lip");
nav[0].addEventListener("mouseover",function(){
	navv[0].style.background = "#12b7f5";
	navv[1].style.background = "transparent";
	navv[2].style.background = "transparent";
})
nav[1].addEventListener("mouseover",function(){
	navv[1].style.background = "#12b7f5";
	navv[0].style.background = "transparent";
	navv[2].style.background = "transparent";
})
nav[2].addEventListener("mouseover",function(){
	navv[0].style.background = "transparent";
	navv[2].style.background = "#12b7f5";
	navv[1].style.background = "transparent";
})
tab.addEventListener("mouseout",function(){
		navv[2].style.background = "#12b7f5";
		navv[1].style.background = "transparent";
		navv[0].style.background = "transparent";
})


   
//footer 划过
var nb = document.querySelectorAll(".box");
var bn = document.querySelectorAll(".boxp")
nb[0].addEventListener("mouseover",function(){
		bn[0].style.color = "#12B8F6";
})
nb[0].addEventListener("mouseout",function(){
	bn[0].style.color = "#666";
})
nb[1].addEventListener("mouseover",function(){
		bn[1].style.color = "#12B8F6";
})
nb[1].addEventListener("mouseout",function(){
	bn[1].style.color = "#666";
})
nb[2].addEventListener("mouseover",function(){
		bn[2].style.color = "#12B8F6";
})
nb[2].addEventListener("mouseout",function(){
	bn[2].style.color = "#666";
})
nb[3].addEventListener("mouseover",function(){
		bn[3].style.color = "#12B8F6";
})
nb[3].addEventListener("mouseout",function(){
	bn[3].style.color = "#666";
})


//高楼效果
var sw = document.querySelector("#toTop");
var t = document.querySelector("#nanav");
if(document.body.offsetWidth>'687'){
	sw.addEventListener("mouseover",function(){
		sw.style.backgroundImage= "url(images/timg2.gif)";
	})
	sw.addEventListener("mouseout",function(){
		sw.style.backgroundImage= "url(images/timg21.gif)";
	})
}
window.onscroll = function(	){
	if(document.documentElement.scrollTop > 800 || document.body.scrollTop > 800){
		t.style.position = "fixed";
		t.style.background = "#fff";
		t.style.zIndex = "999";
		t.style.width = "100%";
	}else{
		t.style.position = "relative";
		t.style.background = "transparent";
	};
	if(document.documentElement.scrollTop > 500 || document.body.scrollTop > 500){
		sw.style.display = "block";
	}else{
		sw.style.display = "none";
		sw.style.bottom = "50px";
		
	}
	sw.addEventListener('click',function(){
		sw.style.bottom = "200px";
		window.scrollTo({
			top:0,
			behavior:'smooth'
		})
	})
}

//nav划过显示
var nv1 = document.querySelectorAll(".navn1");
var nv2 = document.querySelectorAll(".reb2");
var nv3 = document.querySelectorAll(".reb1");
var nv4 = document.querySelectorAll(".reb4");
var nv5 = document.querySelectorAll(".reb4 h6");
var nv6 = document.querySelectorAll(".reb2 a");
var nv7 = document.querySelectorAll("#hq");
var nv8 = document.querySelectorAll(".dlym");
var nv9 = document.querySelectorAll(".dlym .hbb");
var nv10 = document.querySelectorAll(".dlym h4");
var nv11 = document.querySelector(".vid-vo1");
nv3[0].addEventListener("click",function(){
	nv8[0].style.height= "350px";
	nv11.style.height= "100%";
})
nv10[0].addEventListener("click",function(){
	nv8[0].style.height= "0";
	nv11.style.height= "0%";
})
nv8[0].addEventListener("click",function(){
	nv8[0].style.width= "600px";
//	nv11[0].style.display
})
nv4[0].addEventListener("mouseover",function(){
	nv2[0].style.height= "60px";
	nv5[0].style.height= "10px";
})
nv4[0].addEventListener("mouseout",function(){
	nv5[0].style.height= "0";
	nv2[0].style.height= "0";
})
nv6[0].addEventListener("click",function(){
	nv3[0].style.display= "block";
	nv2[0].style.height= "0";
	nv1[0].style.display= "none";
	nv4[0].style.height= "1px";
})
//"http://q2.qlogo.cn/headimg_dl?bs=" ＋ qqNumber ＋ "&dst_uin=" ＋ qqNumber ＋ "&src_uin=" ＋ qqNumber 
//＋ "&fid=" ＋ qqNumber ＋ "&spec=100&url_enc=0&referer=bu_interface&term_type=PC"


	
//视频格式
var sp1 = document.querySelectorAll(".spy p");
var sp2 = document.querySelectorAll(".spy");
var sp3 = document.querySelectorAll(".spdk");
var vid_vo = document.querySelector(".vid-vo");
var sp4 = document.querySelectorAll(".sp");

	sp3[0].addEventListener("click",function(){
		sp2[0].style.height= "540px";
		vid_vo.style.display = "block";
		sp4[0].currentTime=0;
		sp4[0].play();
	})
	sp1[0].addEventListener("click",function(){
		sp2[0].style.height= "0";
		vid_vo.style.display = "none";
//		sp4[0].currentTime=0;
		sp4[0].pause();
	})

//小眼睛
var tdc = document.querySelector(".hb");
var yc = document.querySelector(".yanjing");
yc.addEventListener("click",function(){
	if(tdc.type == "password"){
		tdc.type = "text"
		yc.style.backgroundImage= "url(images/yincangyanjing.png)";
		yc.title= "隐藏密码"
	}else{
		tdc.type = "password"
		yc.style.backgroundImage= "url(images/yanjing.png)";
		yc.title= "查看密码"
	}
})


//二维码切换
var span = document.querySelector(".cpsd span");
var span2 = document.querySelector(".cpsdd span");
var er = document.querySelector(".cpsdd");
var mei = document.querySelector(".cpsd");
span.addEventListener("click",function(){
	er.style.display= "block";
	mei.style.display= "none";
})
span2.addEventListener("click",function(){
	er.style.display= "none";
	mei.style.display= "block";
})




//判断登录数字 密码
	var	dv = document.querySelector(".bettent")
	nv7.value=Number()
	nv9[0].addEventListener("click",function(){
		if(nv7[0].value.length >= 5 && nv7[0].value.length <= 10 ){
			if(nv7.value != Number()){
				dv.innerHTML ="&nbsp;&nbsp;QQ号只支持数字!&nbsp;&nbsp;";
				dv.style.display="block"
				setTimeout(function () {
					dv.style.display="none"
				}, 2000);
			}else{
				var pe = nv7[0].value;
			nv1[0].src = "https://q1.qlogo.cn/g?b=qq&s=640&nk=" + pe;
			nv3[0].style.display= "none";
			nv4[0].style.height= "40px";
			nv8[0].style.height= "0";
			nv1[0].style.display= "block";
			dv.innerHTML ="&nbsp;&nbsp;登录成功。&nbsp;&nbsp;";
			dv.style.display="block"
			setTimeout(function () {
				dv.style.display="none"
			}, 2000);
			nv11.style.height= "0%";
			}
		}else{
			dv.innerHTML ="&nbsp;&nbsp;请输入正确的QQ号!&nbsp;&nbsp;";
			dv.style.display="block"
			setTimeout(function () {
				dv.style.display="none"
			}, 2000);
		}
	})



//头像放大
var txdj = document.querySelector(".txfd");
var tx = document.querySelector(".tx1");
var txbg = document.querySelector(".vid-vo2");
var txgb = document.querySelector(".tx1 p");
if(document.body.offsetWidth>'687'){
	txdj.addEventListener("click",function(){
		var pe = nv7[0].value;
		tx.style.backgroundImage = "url(https://q1.qlogo.cn/g?b=qq&s=640&nk=" + pe + ")";
		txbg.style.height= "100%";
		tx.style.display= "block";
	})
	txgb.addEventListener("click",function(){
		txbg.style.height= "0%";
		tx.style.display= "none";
	})
}
if(document.body.offsetWidth<'687'){
	txdj.addEventListener("click",function(){
		txdj.href= "";
	})
}


